import request from '@/config/request.js'
const { environment } = require('@/config/environment.js')

// 查轮播图
export const queryBannerList = data => request.post('/banner/list', data)

// 轮播图点击
export const apiBannerClick = data => request.post('/banner/click', data)

// 查小程序配置
export const queryMiniProgramInfo = data => request.post('/config/mini/product', data)

// 查首页【本周精选】数据源
export const queryFeaturedList = data => request.post('/video/featured/list', data)

// 查首页【猜你爱看】数据源
export const queryGuessList = data => request.post('/video/guess/list', data)

// 查历史记录列表
export const queryHistoryList = data => request.post(`/video/viewed?page=${data.pageNum}`, data, { loading: false })

// 查短剧的所有剧集库
export const queryVideoEpisode = data => request.post('/video/episode', data)

// 查剧集详情，能得到视频地址
export const queryEpisodeInfo = data => request.post('/video/episode/view', data, { custom: { catch: true } })

// 查询充值套餐
export const queryPackageTemplate = data => request.post('/package/info', data)

// 金币充值-创建订单
export const orderCreateCoin = data => request.post('/order/create/coin', data)

// 会员充值-创建订单
export const orderCreateVip = data => request.post('/order/create/vip', data)

// 微信虚拟支付主动查询
export const wxVirtualOrderQuery = data => request.post(`${environment.baseURL}/common/wxVirtual/order/query`, data, { custom: { catch: true, toast: false, hideLoading: false } })

// 剧集点赞
export const videoLikeVery = data => request.post('/video/like', data, { custom: { loading: false } })

// 剧集取消点赞
export const videoLikeCancel = data => request.post('/video/like/cancel', data, { custom: { loading: false } })

// 追剧
export const videoPursuingVery = data => request.post('/video/pursuing', data, { custom: { loading: false } })

// 取消追剧
export const videoPursuingCancel = data => request.post('/video/pursuing/cancel', data, { custom: { loading: false } })

// 用户反馈
export const addUserFeedback = data => request.post('/user/feedback', data)

// 商务合作
export const addUserBusinessCoop = data => request.post('/user/business/coop', data)
